﻿///<reference path="_references.ts" />
///<reference path="GameStateProvider.ts" />
///<reference path="Game.ts" />


module ScrambledEggs.Debug {
    export class States {
        public static Default: IGameState = ScrambledEggs.GameStateProvider.DefaultState;
        public static StartAnew: IGameState;
        public static AtDoor: IGameState;
        public static BabyFinished: IGameState;
    }

    States.StartAnew = <IGameState>Utility.General.Clone(States.Default);
    States.StartAnew.Name = "Start anew";

    States.AtDoor = <IGameState>Utility.General.Clone(States.StartAnew);
    States.AtDoor.Name = "At the door";
    States.AtDoor.Phase = GamePhase.Baby;
    States.AtDoor.PhysicalMaturity = 350;
    States.AtDoor.MentalMaturity = 350;
    States.AtDoor.Fullness = 99;
    States.AtDoor.LeftPen = true;
    States.AtDoor.DecisionCatFood = ScrambledEggs.CatFoodDecision.Ate;
    States.AtDoor.Inventory["PenKey"] = 1;

    States.BabyFinished = <IGameState>Utility.General.Clone(States.AtDoor);
    States.BabyFinished.Name = "New young adult",
    States.BabyFinished.Phase = ScrambledEggs.GamePhase.YoungAdult;
    States.BabyFinished.PhysicalMaturity = 400;
    States.BabyFinished.MentalMaturity = 400;
    States.BabyFinished.DecisionBabyFinale = ScrambledEggs.BabyFinaleDecision.Jailbreak;
}


var win = <any>window;
win.setStateStartAnew = function () {
    win.withGame(function (game: ScrambledEggs.Game) {
        game.GameState.State = ScrambledEggs.Debug.States.StartAnew;
    });
};
win.setStateAtDoor = function () {
    win.withGame(function (game: ScrambledEggs.Game) {
        game.GameState.State = ScrambledEggs.Debug.States.AtDoor;
    });
};
win.setStateBabyFinished = function () {
    win.withGame(function (game: ScrambledEggs.Game) {
        game.GameState.State = ScrambledEggs.Debug.States.BabyFinished;
    });
};
win.logGameState = function () {
    win.withGame(function (game: ScrambledEggs.Game) {
        console.log(game.GameState.State);
    });
}